#include <iostream>
#include "cjson/cJSON.h"
#include "zlib.h"

using namespace std;
int main() {
    // Test cjson: create json object
    cJSON *root = cJSON_CreateObject();
    cJSON_AddStringToObject(root, "name", "Example with cjson");
    cJSON_AddNumberToObject(root, "version", 0);
    // generate json string
    char *json_str = cJSON_Print(root);
    string json_data(json_str);
    cout << json_data << endl;
    // delete json resource 
    free(json_str);
    cJSON_Delete(root);

    // test zlib
    cout << "test zlib: version is: " << zlibVersion() << endl;
}